package lesson15;

public class Person {
	
	String name;
	int age;
	String personalNumber;
	char sex;
	double weight;
	Person[] friends;
	int health = 50; // from 0 to 100
	int starvationStatus = 50;
	int psychics = 50;
	boolean isMale;
	
	double money;
	
	
	Person() // default constructor
	{
		age = 0;
		weight = 4.0;
	}
	
	Person(String name, String personalNumber, boolean isMale)
	{
		this();
		this.name = name;
		this.personalNumber = personalNumber;
		if (isMale)
			sex = 'M';
		else
			sex = 'F';
	
		this.friends = new Person[3];
	}
	
	
	Person(String personName)
	{
		name = personName;
	}
	
	Person(String personName, int personAge)
	{
		age = personAge;
		name = personName;
	}
	
	Person(int personAge, String personName)
	{
		age = personAge;
		name = personName;
	}
	
	
	void eat(int foodVolume)
	{
		if (starvationStatus + foodVolume >= 100)
			starvationStatus = 100;
		else
			starvationStatus += foodVolume;
	}
	
	void walk()
	{
		System.out.println(name + " is walking!");
		starvationStatus -= 5;
	}
	
	void growUp()
	{
		age++;
	}
	
	void drinkWater(double litres)
	{
		System.out.println(name + " is dringking " + litres + "litres of water");
		starvationStatus+=litres;
	}
	
	void buyCar (Car car)
	{
		//buy car if enough money in bank account
		if(this.money >= car.price)
		{
			//this.car = car;
			
		}
	}
	
	//double sellCarForScrap()
	{
		double metalPrice = 0.37;
		//double returnedMoney = car.calculateCarPriceForScrap(metalPrice);
		//this.money += returnedMoney;
		//return money + returnedMoney;		
	}

}
